package 流程控制.循环结构;

import java.util.FormatFlagsConversionMismatchException;
import java.util.Scanner;

public class 打印三角形 {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        System.out.print("请输入等腰三角形的高：");
        sjx(scanner.nextInt());
        scanner.close();
    }

    /**
     * 输入三角形的高得到三角形
     * @param x
     */
    public static void sjx(int x){
        for (int i = 1; i <= x; i++) {
            for (int i1 = x; i1 > i; i1--) {
                System.out.print(" ");
            }
            for (int i2 = 1; i2 <= 2*i-1; i2++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

}
